package com.wei.myhame.presenter.login;

import android.util.Log;

import com.wei.myhame.base.BasePresenter;
import com.wei.myhame.base.interfaces.contract.login.LoginContract;
import com.wei.myhame.component.CommonSubscriber;
import com.wei.myhame.model.bean.ParametersBean;
import com.wei.myhame.model.bean.ProductBean;
import com.wei.myhame.model.http.HttpManager;
import com.wei.myhame.utils.RxUtils;

import java.util.HashMap;

public class LoginPresenter extends BasePresenter<LoginContract.view>implements LoginContract.presenter {

    @Override
    public void initData(HashMap<String, Object> map) {
        addSubscribe(HttpManager.getLoginServiceApi().getData(map)
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<ProductBean>(mView) {
                    @Override
                    public void onNext(ProductBean productBean) {
                        Log.e("返回的数据",""+productBean.toString());
                        mView.showData(productBean);
                    }
                }));
    }
}
